<?php
/* 
 * akimimi front
 * 
 * Delivery List
 * 
 * @author steve
 * 
 */
require_once '../app/views/BaseView.php';

class DeliveryListView extends BaseView {
	public static function getDeliveryList($deliveryLists){
		$html = '<div class="add_border"><div class="add_title"><ul>';
		$html .= '<li class="style_1">'.RECEIVER.'</li><li class="style_2">'.AREADICT.'</li><li class="style_2">'.DETAILADDRESS.'</li>';
        $html .= '<li class="style_3">'.PHONE.'/'.MOBILE.'</li><li class="style_4">'.EMAILBOX.'</li><li class="style_5">'.OPERATION.'</li>';
		$html .= '</ul></div>';
		foreach($deliveryLists[0] as $delivery){
		    $html .= '<div class="add_row"><ul>';
		    $html .= '<li class="style_1">'.$delivery['name'].'</li>';
            $html .= '<li class="style_2">'.$deliveryLists[1][$delivery['id']]['province'].' '.$deliveryLists[1][$delivery['id']]['city'].' '.$deliveryLists[1][$delivery['id']]['county'].'</li>';
            $html .= '<li class="style_2">'.$delivery['detail_address'].'</li>';
            $html .= '<li class="style_3">'.$delivery['phone_number_1'].'/ '.$delivery['phone_number_2'].'</li>';
            $html .= '<li class="style_4">'.$delivery['email'].'</li>';
       //     $html .= '<li class="style_5"><a href="/userinfo/editdelivery?id='.$delivery['id'].'">'.MODIFY.'</a>/<a onclick=" return confirm('.DELCONFIRM.')" href="/userinfo/deldelivery?id='.$delivery['id'].'">'.DELETE.'</a></li>';
            $editAction = "javascript:Delivery.editDelivery('".$delivery['id']."')";
            $delAction = "javascript:Delivery.delDelivery('".$delivery['id']."')";
            $html .= '<li class="style_5"><span style="cursor:pointer;" onclick="'.$editAction.'">'.MODIFY.'</span>/<span style="cursor:pointer;" onclick="'.$delAction.'">'.DELETE.'</span></li>';
            $html .= '</ul></div>';
		}
		$html .= '</div>';
		
		return $html;
	}
}

?>
